﻿@model ORM.ViewModels.Questions.QuestionBookmarkListViewModel
<div id="questionBookmarkList" class="roundedField" style="background-color: antiquewhite;
    padding-top: 10px; padding-left: 10px">
    <div align="center" style="font-weight: bold">
        Các Câu Hỏi Đã Lưu</div>
    <br />
    <div style="height: 300px">
        <div style="height: 90%">
            @foreach (var item in Model.Questions)
            {
                <a class="titleLink" href="/Question/Details/@item.Id">@item.Title</a><br />
            }
        </div>
        <table width="100%">
            <tr>
                <td style="text-align: left; width: 15%">
                    @if (Model.PageNo != 1)
                    {
                        var targetDiv = "questionBookmarkList";
                        var previousPage = @Model.PageNo - 1;
                        <input type="image" src="/Content/Images/hide-left.ico" id="btnGoFirst" onclick="GoToQuestionBookMarksPage(1, '@targetDiv')" style="width: 20px; height: 20px;" title = "Xem Trang Đầu Tiên" />
                        <input type="image" src="/Content/Images/navigate-left.ico" id="btnGoPrevious" onclick="GoToQuestionBookMarksPage('@previousPage', '@targetDiv')" style="width: 20px; height: 20px;" title = "Xem Trang Trước" />
                    }
                </td>
                <td style="text-align: center; width: 75%">
                    @if (Model.TotalPage == 0)
                    {
                        <span>Bạn chưa lưu câu hỏi nào vào sổ tay</span>
                    }
                    else
                    {
                        <span>Trang @Model.PageNo Trên Tổng Số @Model.TotalPage Trang</span>
                    }
                </td>
                <td style="text-align: right; width: 15%">
                    @if (Model.PageNo != Model.TotalPage && Model.TotalPage != 0)
                    {
                        var targetDiv = "questionBookmarkList";
                        var nextPage = @Model.PageNo + 1;
                        <input type="image" src="/Content/Images/navigate-right.ico" id="btnGoNext" onclick="GoToQuestionBookMarksPage('@nextPage', '@targetDiv')" style="width: 20px; height: 20px" title="Xem Trang Sau" />
                        <input type="image" src="/Content/Images/hide-right.ico" id="btnGoNext" onclick="GoToQuestionBookMarksPage('@Model.TotalPage', '@targetDiv')" style="width: 20px; height: 20px" title = "Xem Trang Cuối"/>
                    }
                </td>
            </tr>
        </table>
    </div>
</div>
